const redis = require('redis')
const client = redis.createClient()
const bluebird = require('bluebird')
bluebird.promisifyAll(redis.RedisClient.prototype);

const get = async (k) => {
  const result = await client.getAsync(k)
  return result
}

const set = async (k, v, expire) => {
  return await client.setAsync(k, v, 'EX', expire)
}

module.exports = {
  get,
  set
}